package com.xisoft.devise.controller;

import com.xisoft.common.aspect.AppMonitorRuning;
import com.xisoft.common.result.Result;
import com.xisoft.devise.service.ISalaryDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * *
 * Created with Description:
 *
 * @version 1.0 <br>
 * @packagename: com.xisoft.devise.controller<br>
 * @author: LiBencheng <br>
 * @computer: licheng <br>
 * @date: Created on 2022/8/12 14:57 <br>
 */
@RestController
@RequestMapping ("/salary")
public class SalaryDataController
{
    @Qualifier ("SalaryDataImpl")
    @Autowired
    ISalaryDataService service;

    @PostMapping ("/delSalaryDataAgg")
    @AppMonitorRuning (method = "SalaryDataController.delSalaryDataAgg", funEffect = "delSalaryDataAgg！")
    public Result delSalaryDataAgg(HttpServletRequest request, HttpServletResponse response) throws Exception
    { return Result.ok(service.delSalaryData(request.getParameter("table"))); }

    @RequestMapping ("/updSalaryData")
    // @RequestMapping (name = "/updSalaryData", method = {RequestMethod.POST})
    @AppMonitorRuning (method = "SalaryDataController.updSalaryData", funEffect = "修改updSalaryData！")
    public Result updSalaryData(HttpServletRequest request, HttpServletResponse response) throws Exception
    {
        service.updSalaryData(request.getParameter("table"));
        return Result.ok("");
    }

    //The valid characters are defined in RFC 7230 and RFC 3986
    @GetMapping ("/getSalaryDataAgg")
    @AppMonitorRuning (method = "SalaryDataController.getSalaryDataAgg", funEffect = "getSalaryDataAgg！")
    public Result getSalaryDataAgg(HttpServletRequest request, HttpServletResponse response) throws Exception
    { return Result.ok(service.getSalaryDataAgg(request.getParameter("table"))); }
 
}
